package com.cc8w.admin.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.dubbo.config.annotation.Service;
import com.cc8w.admin.mapper.UserMapper;
import com.cc8w.admin.service.UserService;
import com.cc8w.entity.UserEntity;

@Service(version = "1.0.0",timeout = 10000,interfaceClass=UserService.class) //注意：这里是dubbo的注解,这个等价于<dubbo:service...>
@Component("userService") //spring 的@service注解也可以用@Component
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    @Qualifier("userMapper")
    private UserMapper userMapper;

    @Override
    public UserEntity queryUserByUserName(String userName){
    	UserEntity u = userMapper.queryUserByUserName(userName);
    	System.out.println(u);
    	return u;
    }

}
